<!DOCTYPE html>
<html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <title>【<?php echo $output['seller']['nickname']?>】的<?php echo $output['site_name'];?></title>
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/shop.css" rel="stylesheet" type="text/css">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/touch.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            $(".qrcode").on("click", function () {
				location.href = 'index.php?act=my&op=qrcode&seller_id=<?php echo $output['seller']['user_id'];?>';
            });
        });
    </script>
    <link rel="stylesheet" href="<?php echo TEMPLATE_SITE_URL;?>/css/animate.min.css">
	<script src="<?php echo RESOURCE_SITE_URL;?>/js/wow.min.js"></script>
	<script>
	if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
			new WOW().init();
		};
	</script>
</head>
<body>
<div class="concernDiv dowebok" id="pop2" style="display:none;">
  <div class="concern wow  fadeInUp"><p class="conTitle">取消关注将无法看到该店铺的拍品</p>
  <a class="whiteBn">取消关注</a>
  <a class="greyBn">取消</a></div>
</div>
<div id="contentbox">
    <div class="header">
        <div class="head">
            <div class="qrcode"></div>
        </div>
        <div class="avatar">
            <a href="index.php?act=my&op=home&uid=<?php echo $output['seller']['user_id'];?>">
                <img src="<?php echo $output['seller']['avatar'];?>">
            </a>
        </div>
        <div class="sellerInfoBox">
            <div class="leftBox">
                <div class="name">
                    <a href="index.php?act=my&op=home&uid=<?php echo $output['seller']['user_id'];?>" class=""><?php echo $output['seller']['nickname'];?></a>
                	<?php if($output['seller']['is_company']==1){?>
	                	<?php if($output['seller']['is_company_type']==1){?>
	                	<img src="<?php echo TEMPLATE_SITE_URL;?>/images/blue_certify.png">
	                	<?php }else{?>
	                	<img src="<?php echo TEMPLATE_SITE_URL;?>/images/certify.png">
	                	<?php }?>
                	<?php }?>
                	
                </div>
                <div class="level l<?php echo strtolower($output['seller']['slevel']);?>"></div>
                <div class="scores">评分 <?php echo $output['seller_pingfen'];?></div>
                <div class="fans">粉丝<?php echo $output['fcount'];?></div>
            </div>
            <?php if($_GET['seller_id']!=$_COOKIE['user_id']){?>
            <?php if($output['guanzhu']==1){?>
            <button class="attentioned"></button>
            <?php }else{?>
            <button class="attention"></button>
            <?php }?>
            <?php }?>
            </div>
            <div class="notice">
                <div><?php echo $output['seller']['signature'];?></div>
            </div>
            </div>

    <div class="tabListBox">
        <div class="tabBox  createTime">
            <div class="tab">
                新品开拍
            </div>
        </div>
        <div class="tabBox distanceTime selected">
            <div class="tab">
                即将截拍
            </div>
        </div>
        <?php if($output['seller']['user_id']==$_COOKIE['user_id']){?>
        <div class="tabBox jiepaiauction">
            <div class="tab">
                截拍拍品           </div>
        </div>
        <?php }else{?>
                <div class="tabBox bidTime">
            <div class="tab">
                参拍拍品            </div>
        </div>
        <?php }?>
        <div class="tabBox allSale">
            <div class="tab">
                全部拍品
            </div>
        </div>
    </div>
    <div class="saleMain" id="createTime">
    	<?php if($output['count']=='0'){?>
    	<div class="shopEmpty" style="display:block;"></div>
    	<?php }?>
    </div>
</div>

<input type="hidden" name="haspage" value="1" id="haspage">
<input type="hidden" name="pagenum" value="0" id="pagenum">
<div class="loadNextPage" style="margin-top:10px;color:#777;text-align:center;font-size:13px;display:none;">
	<div class="loading" style="width:100px;height:40px;margin-left:auto;margin-right:auto">
		<img src="<?php echo TEMPLATE_SITE_URL;?>/images/loadingData.gif" style="float:left">
		<span style="float:left;margin-top:10px;">加载数据</span>
	</div>
</div>

<script type="text/javascript">
$(function(){

	$('.createTime').click(function(){
		location.href = 'index.php?act=shop&op=index&seller_id='+<?php echo intval($_GET['seller_id']);?>;
		return false;
	});
	
	$('.bidTime').click(function(){
		location.href = 'index.php?act=shop&op=bidauction&seller_id='+<?php echo intval($_GET['seller_id']);?>;
		return false;
	});

	$('.jiepaiauction').click(function(){
		location.href = 'index.php?act=shop&op=endauction&seller_id='+<?php echo intval($_GET['seller_id']);?>;
		return false;	
	});
	
	$('.attentioned').click(function(){
		$('#pop2').show();
	});

	$('.greyBn').click(function(){
		$('#pop2').hide();
	});

	$('.whiteBn').click(function(){
		var uid = '<?php echo $_COOKIE['user_id'];?>';
		var fid = '<?php echo intval($_GET['seller_id']);?>';

		$.ajax({
			type:'get',
			url:'index.php?act=my&op=cancelguanzhu',
			data:{uid:uid,fid:fid},
			dataType:'json',
			success:function(data){
				if(data.state){
					location.reload();
				}
				return false;
			}
		});
	});
	
	$('.attention').click(function(){
		var uid = '<?php echo $_COOKIE['user_id'];?>';
		var fid = '<?php echo intval($_GET['seller_id']);?>';

		$.ajax({
			type:'get',
			url:'index.php?act=my&op=guanzhu',
			data:{uid:uid,fid:fid},
			dataType:'json',
			success:function(data){
				if(data.state){
					location.reload();
				}
				return false;
			}
		});	
	});
	$('.allSale').tap(function(){
		location.href = 'index.php?act=index&seller_id=<?php echo intval($_GET['seller_id']);?>';
		return false;
	});
	
	$(window).scroll(function () {
	    var $body = $("body");
	    if (($(window).height() + $(window).scrollTop()) >= $body.height()) {
	        var haspage = parseInt($('#haspage').val());
	        if(haspage=='0'){
				return false;
			}
			var pagenum = parseInt($('#pagenum').val());
			var nextpage = eval(pagenum+1);
					
			ajaxdata(nextpage);
	    }
	});

	function ajaxdata(nextpage){
		var seller_id = '<?php echo intval($_GET['seller_id']);?>';
		$.ajax({
			type:'get',
			url:'index.php?act=shop&op=distancetimedata',
			data:{nextpage:nextpage,seller_id:seller_id},
			dataType:'html',
			success:function(html){
				$('.loadNextPage').hide();
				if(html==''){
					$('#haspage').val('0');
				}else{
					$('#pagenum').val(nextpage);
					$('#createTime').append(html);
				}

	            $('.saleMain').on('click', '.saleItem', function (e) {
	                e.preventDefault();
	                document.location.href = 'index.php?act=index&auction_id=' + $(this).attr('auction_id');
	            });
			},
			beforeSend:function(){
				$('.loadNextPage').show();
			}
		});
	}

	ajaxdata(1);
});
</script>

<script type='text/javascript'>
	$(function(){	
		var time = parseInt("<?php echo TIMESTAMP;?>");
		$('.process').each(function(){
			var lag = parseInt($(this).attr('endtime')) - time;
			if(lag>0){
			   var second = Math.floor(lag % 60);    
			   var minite = Math.floor((lag / 60) % 60);
			   var hour = Math.floor((lag / 3600) % 24);
			   var day = Math.floor((lag / 3600) / 24);
			   $(this).html('<span style="font-size:12px;">&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span style="font-size:12px;">&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span style="font-size:12px;">&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span style="font-size:12px;">&nbsp;'+second+'&nbsp;</span>');
			}
		});
		function updateEndTime(){
			time++;		
			$(".process").each(function(){
				var lag = parseInt($(this).attr('endTime')) - time;
				if(lag>0){
				    var second = Math.floor(lag % 60);    
				    var minite = Math.floor((lag / 60) % 60);
				    var hour = Math.floor((lag / 3600) % 24);
				    var day = Math.floor((lag / 3600) / 24);
					$(this).html('<span style="font-size:12px;">&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span style="font-size:12px;">&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span style="font-size:12px;">&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span style="font-size:12px;">&nbsp;'+second+'&nbsp;</span>');
				}else{
					var aid = $(this).attr('aid');
					var html = '<div class="saleEndBtn">'+$(this).attr('con')+'&nbsp;拍卖结束 </div>';
					$('div[cur="'+aid+'"]').remove();
					$('div[bidaid="'+aid+'"]').html(html);
				}
			});
			setTimeout(updateEndTime,1000);
		}
		setTimeout(updateEndTime,1000);
	});
</script>
<?php include template('home/nav');?>
</body>
</html>